//
//  DetailsTwoTableViewCell.m
//  Fragrance
//
//  Created by dllo on 15/5/28.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "DetailsTwoTableViewCell.h"

@implementation DetailsTwoTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self CreateDetaisCell];
    }
    return self;
}

- (void)CreateDetaisCell
{
    self.goodsIconOne = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.goodsIconOne];
    
    self.nameLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.nameLabel];
    
    self.priceLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.priceLabel];
    
    self.priceMarkLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.priceMarkLabel];
    
    self.favoriteNumLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.favoriteNumLabel];
    self.favoritePersonLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.favoritePersonLabel];
    
    self.chefIcon = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.chefIcon];
    
    self.shopNameLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.shopNameLabel];
    
    self.distanceLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.distanceLabel];
    
    self.introduceLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.introduceLabel];
    
    self.descLabel = [[[UILabel alloc] init] autorelease];
    [self.contentView addSubview:self.descLabel];
    
    self.goodsIconTwo = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.goodsIconTwo];
    
    self.goodsIconThird = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.goodsIconThird];
    
    self.goodsIconFourth = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.goodsIconFourth];
    
    self.goodsIconFifth = [[[UIImageView alloc] init] autorelease];
    [self.contentView addSubview:self.goodsIconFifth];
    
    
    
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.goodsIconOne.frame = CGRectMake(10, 10, self.contentView.frame.size.width - 20, 150);
    self.goodsIconOne.backgroundColor = [UIColor greenColor];
    
    self.nameLabel.frame = CGRectMake(120, 170, 150, 40);
    self.nameLabel.backgroundColor = [UIColor redColor];
    
    self.distanceLabel.frame = CGRectMake(150, 220, 100, 40);
    self.distanceLabel.backgroundColor = [UIColor greenColor];
    
    self.priceLabel.frame = CGRectMake(150, 280, 100, 40);
    self.priceLabel.backgroundColor = [UIColor greenColor];
    self.priceMarkLabel.frame = CGRectMake(120, 280, 30, 40);
    self.priceMarkLabel.backgroundColor = [UIColor redColor];
    self.priceMarkLabel.text = @"¥";
    
    self.favoriteNumLabel.frame = CGRectMake(150, 330, 50, 40);
    self.favoriteNumLabel.backgroundColor = [UIColor redColor];
    self.favoritePersonLabel.text = @"人想吃";
    self.favoritePersonLabel.frame = CGRectMake(200, 330, 100, 40);
    self.favoritePersonLabel.backgroundColor = [UIColor greenColor];
    
    self.chefIcon.frame = CGRectMake(150, 380, 80, 80);
    self.chefIcon.backgroundColor = [UIColor redColor];
    self.chefIcon.layer.cornerRadius = 40;
    self.chefIcon.layer.masksToBounds = YES;
    
    self.shopNameLabel.frame = CGRectMake(150, 470, 100, 40);
    self.shopNameLabel.backgroundColor = [UIColor greenColor];
    
    self.introduceLabel.frame = CGRectMake(150, 520, 100, 40);
    self.introduceLabel.text = @"美食介绍";
    self.introduceLabel.backgroundColor = [UIColor redColor];
    
    self.descLabel.frame = CGRectMake(10, 570, self.contentView.frame.size.width - 20, 60);
    self.descLabel.backgroundColor = [UIColor redColor];
    self.descLabel.numberOfLines = 3;
    [self.descLabel sizeToFit];
    
    self.goodsIconTwo.frame = CGRectMake(10, 640, self.contentView.frame.size.width - 20, 150);
    self.goodsIconTwo.backgroundColor = [UIColor greenColor];
    
    self.goodsIconThird.frame = CGRectMake(10, 800, self.contentView.frame.size.width - 20, 150);
    self.goodsIconThird.backgroundColor = [UIColor greenColor];
    
    self.goodsIconFourth.frame = CGRectMake(10, 960, self.contentView.frame.size.width - 20, 150);
    self.goodsIconFourth.backgroundColor = [UIColor redColor];
    
    self.goodsIconFifth.frame = CGRectMake(10, 1120, self.contentView.frame.size.width - 20, 150);
    self.goodsIconFifth.backgroundColor = [UIColor greenColor];
    
    
    
    
}
- (void)setModel:(CftModelData *)model
{
    self.nameLabel.text = model.name;
    self.shopNameLabel.text = model.shopName ;
    self.descLabel.text = model.desc;
    self.priceLabel.text = model.price;
    self.distanceLabel.text = model.distance;
    self.favoriteNumLabel.text = model.favoriteNum;
}




- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
